local _build = vim.fn.has("win32") ~= 0 and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false"
    or "make"
return {
  "yetone/avante.nvim",
  event = "VeryLazy",
  lazy = false,
  version = false, -- set this if you want to always pull the latest change
  build = _build,
  opts = {
    provider = "ollama",
    providers = {
      -- deepseek = {
      --   enabled = false,
      --   __inherited_from = "openai",
      --   api_key_name = "DEEPSEEK_API_KEY",
      --   -- api_key_name = deepseek_api_key,
      --   endpoint = "https://api.deepseek.com",
      --   model = "deepseek-coder",
      --   -- 可用的deepseek模型
      --   models = {
      --     "deepseek-coder",
      --     "deepseek-chat",
      --     "deepseek-reasoner",
      --     "deepseek-v2",
      --     "deepseek-v2-lite",
      --   },
      -- },
      -- 本地模型支持
      ollama = {
        -- __inherited_from = "ollama",
        endpoint = "http://localhost:11434",
        model = "deepseek-coder:latest",
        -- model = "deepseek-r1:latest",
        -- 可用的ollama模型
        models = {
          "deepseek-r1:latest",
          "deepseek-coder:latest",
          -- "qwen2.5:7b",
          -- "qwen2.5:14b",
          "llama3.1:8b",
          -- "codellama:latest",
          -- "phi3:latest",
          -- "mistral:latest",
        },
      },
    },
  },
  dependencies = {
    "L3MON4D3/LuaSnip",
    "nvim-treesitter/nvim-treesitter",
    "stevearc/dressing.nvim",
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
    --- The below dependencies are optional,
    "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
    "zbirenbaum/copilot.lua",      -- for providers='copilot'
    {
      -- support for image pasting
      "HakonHarnes/img-clip.nvim",
      event = "VeryLazy",
      opts = {
        -- recommended settings
        default = {
          embed_image_as_base64 = false,
          prompt_for_file_name = false,
          drag_and_drop = {
            insert_mode = true,
          },
          -- required for Windows users
          use_absolute_path = true,
        },
      },
    },
    {
      -- Make sure to set this up properly if you have lazy=true
      "MeanderingProgrammer/render-markdown.nvim",
      opts = {
        file_types = { "markdown", "Avante" },
      },
      ft = { "markdown", "Avante" },
    },
  },
}
